<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/view/common/includes.jsp" %>
<%@ include file="/WEB-INF/view/inc.jsp" %>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<style>
    /* .panel-body {
       border-width: 0px;
   }*/
</style>

<script type="text/javascript">
    $(function () {
        $("#left_tree").tree({
            onSelect: function (node) {
                $("#orgParentName").textbox("setValue", node.text);
                $("#id").val(node.id);
                sy_searchFun($("#grid"));
            }
        });
    });

</script>
<body class="easyui-layout">
<div data-options="region:'west',href:'',split:false" title="组织机构" style="width: 200px;">
    <div style="overflow: auto;padding-top:10px;padding-left: 10px;width: 90%;">
        <div id="left_tree" class="easyui_tree"
             data-options="url:'<%=contextPath%>/sys/organization/commonTreeMore',method:'get',animate:true,checkbox:false,parentField:'parentId'">
        </div>
    </div>
</div>
</div>
<div data-options="region:'center',plain:true" style="overflow: hidden; border:0px;">
    <div class="easyui-layout" data-options="fit : true,border : false">
        <!-- 搜索框 -->
        <div data-options="region:'north',title:'查询条件',border:false" style="height:80px; overflow: hidden">
            <form id="searchForm" class="form">
                <div class="fitem fl">
                    <label>当前机构:</label>
                    <input id="orgParentName" name="orgParentName" class="easyui-textbox" readonly>
                    <input id="id" name="id" type="hidden"/>
                    <label>机构名称:</label>
                    <input name="orgName" class="easyui-textbox">
                </div>
                <div class="fitem searchItem fr">
                    <a class="easyui-linkbutton" iconCls="icon-search" onclick="sy_searchFun()">搜索</a>
                    <a class="easyui-linkbutton" iconCls="icon-reload" onclick="sy_resetFun()">重置</a>
                </div>
            </form>
        </div>
        <div data-options="region:'center',border:false">
            <table id="grid" class="easyui-datagrid"
                   data-options="url:'<%=contextPath%>/sys/organization/list',fitColumns:true,singleSelect:true, idField: 'id', rownumbers: true,
                 fit: true, fitColumns: true, pagination: true, striped: true,  sortName: 'level',toolbar:'#toolbar'">
                <thead>
                <tr>
                    <th data-options="field:'orgName',width:100">机构名称</th>
                    <th data-options="field:'contractPerson',width:100">联系人</th>
                    <th data-options="field:'tel',width:100">联系电话</th>
                    <th data-options="field:'address',width:100">地址</th>
                    <th data-options="field:'parentId',width:100 ,formatter:sy_other_org">上级机构</th>
                    <th data-options="field:'status',dictionary:'status',formatter:sy_dict" width="100">机构状态</th>
                    <th data-options="field:'remark',width:100">备注</th>
                </tr>
                </thead>
            </table>
        </div>
    </div>
</div>
<!-- 按钮-->
<div id="toolbar" style="display: none;">
    <t:button action="org_add" iconCls="icon-add" buttonName="新增" onclick=""/>
    <t:button action="org_edit" iconCls="icon-edit" buttonName="编辑" onclick=""/>
    <t:button action="org_remove" iconCls="icon-remove" buttonName="删除" onclick=""/>


    <%-- <a class="easyui-linkbutton" iconCls="icon-edit" plain="true"
        onclick=" sy_excelImpFun('/pageJump?url=sys/organization/orgExcelImport','Excel导入组织机构',$('#grid'),'400px','200px',$('#left_tree'))">Excel导入</a>
--%>
</div>
<script type="text/javascript">

    var sy_excelImpFun = function (url, title, grid, width, height, $menuTree) {
        var dialog = parent.sy.modalDialog({
            title: title,
            url: url,
            width: width,
            height: height,
            buttons: [{
                text: '上传',
                iconCls: "icon-ok",
                handler: function () {
                    parent.sy_ExcelImport(dialog, grid, parent.$, $menuTree);
                }
            }, {
                text: '取消',
                iconCls: "icon-cancel",
                handler: function () {
                    dialog.dialog('destroy');
                }
            }]
        });
    };
</script>
</body>
</html>




